package com.woniuxy.background.dao;

import com.woniuxy.background.pojo.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface AdminMapper {
    int deleteByPrimaryKey(Integer adminId);

    int insert(Admin record);

    int insertSelective(Admin record);

    Admin selectByPrimaryKey(Integer adminId);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    @Select("select * from admin where username = #{value}")
    Admin findByName(String username);

    @Select("select * from admin")
    List<Admin> adminList();

    @Select("select * from admin where role_id = #{roleId}")
    List<Admin> selectAdminByRoleId(int roleId);
}